package com.example.mytayunapi.Mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface FileMapper {
    @Update("UPDATE user SET aureole = #{newAvatarPath} WHERE School_degree = #{userId}")
    void updateUserAvatar(@Param("userId") String userId, @Param("newAvatarPath") String newAvatarPath);

    @Insert("INSERT INTO Share_posts (School_degree, Share_title, Share_image, Share_status, Share_content, Share_catagory)\n" +
            "VALUES (#{School_degree}, #{Share_title}, #{newAvatarPath}, '审核中', #{Share_content}, #{category});")
    void insertUser(@Param("School_degree") String School_degree, @Param("newAvatarPath") String newAvatarPath,
                    @Param("Share_title") String Share_title, @Param("category") String category,
                    @Param("Share_content") String Share_content);
}

